<div class="row">
  <div class="span3 bs-docs-sidebar ">
 	<*include file="<*$controller*>/location.tpl"*>
  </div>
<*if !$groupid*>  
  <div class="span3"> 
        <table class="table table-bordered table-hover" style="cursor:pointer; margin-top:15px; margin-left:20px;" >
            <tr><th>机构名</th></tr>
            <*foreach from=$result item=item key=key*>
            <tr onclick="chooseit(<*$item.groupid*>)"><td><*$item.groupname*></td></tr>
            <*/foreach*>
        </table>
  </div>
<*else*> 
  <div class="span8" style="margin-top:20px;padding-left:30px;"><*$groupname*></div> 
  <div class="span8"> 
	  <form action="/<*$controller*>/<*$action*>/groupid/<*$groupid*>" method="get" >
      
            <div class="span3" style="float:left;">
                <select name="schoolid" id="schoolid" style=" float:left;width:300px; margin-top:20px; z-index:200;"> 
                    <option value="">---选择校区---</option> 
                    <*foreach from =$school item=a key=k*>
                    <option value="<*$a.schoolid*>" <*if $schoolid==$k*> selected<*/if*>><*$a.schoolname*></option> 
                    <*/foreach*>
                </select>
            </div>
            <div class="span3" style="float:left; margin-top:21px; padding-left:10px;">
                <button type="submit" class="btn btn-primary btn-small" >查询</button>
            </div>
      </form>
    <*if $schoolid*>
    <*if $statistics*>  
    <div style="clear:both;">
    <div style="padding-top:15px;">
        <table class="table table-bordered table-hover" style="margin-left:30px;" >
            <tr><th>班级</th><th>姓名</th><th>时间</th><th>商品</th><th>数量</th><th>花费</th><!--<th>所得积分</th>--></tr>
            <*foreach from=$statistics item=item key=key*>
            <tr><td><*$item.classname*></td><td><*$item.cnname*></td><td><*$item.paytime|date_format:"%Y-%m-%d %H:%M"*></td><td><*$item.goodsname*></td><td><*$item.buynum*></td><td><*$item.paymoney*></td>
            </tr>
            <*/foreach*>
        </table>
    </div> 
    </div>
    <*else*>
    <div style="clear:both; margin-left:30px; padding-top:20px;">数据为空！</div>    
    <*/if*>
    <*else*>
    <div style="clear:both; margin-left:30px; padding-top:20px;">请选择校区！</div>
    <*/if*>   
 </div>
<*/if*>
</div>

<script type="text/javascript">

function chooseit(adid)
{
   window.location='/<*$controller*>/statistics/groupid/'+adid;
}

function deleteit(adid)
{
  if(confirm("删除将不能恢复")){
   window.location='/<*$controller*>/delete/vid/'+adid;
  }
}

</script> 
